import { defineConfig } from 'vite'
import typescript from '@rollup/plugin-typescript'
export default defineConfig({
  build: {
    target: 'esnext',
    outDir: 'dist',
    emptyOutDir: true,
    lib: {
      entry: 'src/index.ts',
      formats: ['es'],
      fileName: 'index',
      name: 'ActorLoader'
    },
    rollupOptions: {
      external: ['three'],
      plugins: [
        typescript({
          sourceMap: false,
          inlineSources: false,
          declaration: true,
          declarationDir: 'dist'
        })
      ]
    }
  }
})